package com.bweab.controll.userstbcontrol;

import com.bweab.service.api.UsersTbServiceInterface;
import com.bweab.service.impl.UsersTbServiceInterfaceImpl;
import com.bweab.util.JSONResult;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;


@WebServlet("/adminDeleteUserInfoByUserName")
public class AdminDeleteUserInfoByUserName extends HttpServlet {

    //创建服务对象

    UsersTbServiceInterface usersTbService =new UsersTbServiceInterfaceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        //获取用户信息
        String userName = req.getParameter("userName");
        //调用dao
        JSONResult jsonResult= usersTbService.adminDeleteUserInfoByUserName(userName);

        WebUtil.writeJson(resp,jsonResult);

    }
}
